package com.sweet.fourtimeoa.controller;

import com.sweet.fourtimeoa.pojo.entity.IncomeProofApplications;
import com.sweet.fourtimeoa.pojo.entity.TravelApplications;
import com.sweet.fourtimeoa.service.impl.TraveServiceImpl;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.HashMap;
import java.util.Map;

@Tag(name = "人事管理—出差申请")
@RestController
@RequestMapping("/oa/travel")
@CrossOrigin(origins = "*")
public class TravelController {
    @Autowired
    private TraveServiceImpl traveServiceimpl;

    @Operation(summary ="人事管理—出差申请—新增")
    @PostMapping("/addition")
    public Map<String,String> addSeal(@RequestBody TravelApplications travelApplications) {
        System.out.println(travelApplications);
        Map<String,String> map = new HashMap<>();
        boolean isok = traveServiceimpl.addTravel(travelApplications);
        if (isok==true){
            map.put("result","true");
        }else {
            map.put("result","false");
        }
        return map;
    }
}
